package cc.iotkit.data.service;

import cc.iotkit.data.mapper.IJPACommData;
import cc.iotkit.data.manager.IProductModelData;
import cc.iotkit.data.model.TbProductModel;
import cc.iotkit.model.product.ProductModel;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Primary
@Service
public class ProductModelDataImpl implements IProductModelData, IJPACommData<ProductModel, String, TbProductModel> {

    @Resource
    private ProductModelService productModelService;


    @Override
    public ProductModelService getBaseRepository() {
        return productModelService;
    }

    @Override
    public Class getJpaRepositoryClass() {
        return TbProductModel.class;
    }

    @Override
    public Class getTClass() {
        return ProductModel.class;
    }

    @Override
    public ProductModel findByModel(String model) {
        return productModelService.findByModel(model);
    }

    @Override
    public List<ProductModel> findByProductKey(String productKey) {
        return productModelService.findByProductKey(productKey);
    }


}
